// TOWN DIALOGUE SCRIPT
//    Town 106: Remote Aerie

begintalkscript;

variables;

short i,j,k,r1,choice;

// Zalifar

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Zalifar";
	text1 = "You meet a wizard of the Empire, currently living a hermitic existence in the mountains of eastern Valorim. However, he doesn't seem reclusive or unhappy to see you. In fact, he seems very pleased and relieved.";
	text2 = "_I am Zalifar. Welcome to my home. I hope the journey was not too difficult._";
	text5 = "Zalifar says, _What else would you like to discuss? Anything else you wish to ask me about?_ His hermitic existence seems to have left him eager for company.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_It was difficult to get up here. I had to fly._";
	text1 = "_Ahh. How nice. I live here because it is an easy place from which I can fly about. I could rhapsodize for hours about the joys of the wind, of the heights, of soaring far above the land. However, that's not why I'm glad you're here._";
	text2 = "_I have been waiting for someone to come here, so I can discuss the land's troubles._";

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_Why do you live in such a remote area?_";
	text1 = "_I live up here, experiencing my wizardry without interference. I also love the joys of flying. Alas, while in the sky, I see many of this land's troubles._";

begintalknode;
	state = 2;
	nextstate = -1;
	condition = 1;
	question = "_How do you know how to fly?_";
	text1 = "_It is my own magic. I know how to summon it, but I don't know how to teach it. Yet._";
	
begintalknode;
	state = 2;
	nextstate = -1;
	question = "_Interference?_";
	text1 = "_Interference from the monsters who plague our lands. Also, interference from the laws of the Empire. They place very strict controls upon us wizards. This annoys me._";

begintalknode;
	state = 2;
	nextstate = 4;
	condition = gf(308,0) == 0;
	question = "_What do you know about the troubles in Valorim?_";
	text1 = "_The land is being overrun by golems. Nobody below knows where they come from. I do. If you assist me, I will give you the location of their lair._";
	text3 = "_The land is being overrun by golems. Nobody below knows where they come from. I do. I will give you the location of their lair._";
	action = DEP_ON_SDF 106 11 1;

begintalknode;
	state = 4;
	nextstate = 5;
	condition = gf(106,11) <= 1;
	question = "_What sort of assistance can I give?_";
	text1 = "_I wish you to assist me in dealing with a drake._";


begintalknode;
	state = 5;
	nextstate = 6;
	question = "_Tell me about this drake._";
	text1 = "_An enormous drake lives in the mountains southwest of Greendale. You can only get there by flying. It's west of a large field of rubble which is south of Greendale._";
	text2 = "_We saw each other frequently when flying, but had a sort of a truce. Until recently._";

begintalknode;
	state = 6;
	nextstate = 10;
	question = "_What happened recently?_";
	text1 = "_Recently, it has started to chase me, actually trying to kill me! It seemed maddened. Go find it, and do something to ensure it will never attack me. In return, I will give you assistance in finding the golems._";
	action = SET_SDF 106 11 1;
	code =
		toggle_quest(113,1);
	break;

begintalknode;
	state = 10;
	nextstate = -1;
	question = "_How can I keep it from attacking you?_";
	text1 = "_That is up to you. Of course, if it is killed, it will not attack me anymore. But it is a wise and mighty creature, and I hope it will not come to that._";


begintalknode;
	state = 1;
	nextstate = -1;
	question = "_Can you teach me anything about wizardry?_";
	text1 = "_I would like to. But the things I know are not things that would aid you in your battles. See if you can get into the town of Gale. I think there is someone in there who can help you._";



begintalknode;
	state = 1;
	nextstate = -1;
	condition = (gf(107,8) >= 1 || gf(107,9) >= 1) && gf(106,11) <= 1;
	question = "_I dealt with the drake that was giving you problems._";
	text1 = "You tell Zalifar of your encounter with Dalakros. He nods. _All right then. I will aid you. When I was flying over certain areas, I saw a large spire. I must give you information about it. It is important that someone knows._";
	code =
		sf(106,11,2);
	break;
	
begintalknode;
	state = 1;
	nextstate = 8;
	condition = gf(106,11) > 1;
	question = "_How do I enter the golem spire?_";
	text1 = "_The golem's spire is directly northwest of Tevrono. It is magically hidden. It's in a large meadow, and you need to look at it and concentrate for several minutes before you can see it._ (You take note of this.)";
	text2 = "_Also interesting are the stone circles and their crystals._";
	code =
		toggle_quest(111,3);
		toggle_quest(113,3);
		run_game_hardcode(9);

	break;

begintalknode;
	state = 8;
	nextstate = -1;
	question = "_Tell me about the stone circles._";
	text1 = "_The spire is surrounded by four stone circles, two in the woods, two in the mountains. I'm sure they have something to do with the golem spire. They seem to feed it power. They may need to be destroyed._";
	text2 = "_One of the two in the mountains I could reach by flying there, but one I couldn't. Maybe there's a tunnel to it from somewhere._";
	

begintalknode;
	state = 1;
	nextstate = 9;
	condition = gf(308,0) >= 1;
	question = "_The golems have been defeated. Can you tell me more about the land's troubles?_";
	text1 = "_That the disease, the rot, is much deeper than what is caused by the golems. The true enemy is not the golems. It is farther out. You should seek a way into Footracer Province._";
	text2 = "_I cannot be sure, but I believe the answer lies in there._";

begintalknode;
	state = 9;
	nextstate = 12;
	question = "_Do you know how to enter Footracer Province?_";
	text1 = "_No. You will need to speak to the people who sealed it. They can be found in Blackcrag Fortress._";

begintalknode;
	state = 12;
	nextstate = -1;
	question = "_Would being able to fly help?_";
	text1 = "_No. Flight will not work. The magical defenses sealing the province will burn you out of the sky. A way to reach the Keep of Tinraya, capital of Footracer, can only be found in Blackcrag Fortress._";
